<!DOCTYPE html><html lang="zh-CN"><head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>monthsShort | Moment.js &#x6587;&#x6863;</title>
  <link rel="stylesheet" href="static/css/style.css">
  <link rel="shortcut icon" href="http://momentjs.cn/static/img/moment-favicon.png">
  <link rel="stylesheet" href="static/css/atom-one-light.min.css">
</head>
<body class="is-moment">
  <div class="hero hero-oneline">
    <div class="hero-centered">
      <h1>monthsShort</h1>
    </div>
  </div>
  <div id="api-section-__FILENAME__">
    <div id="content" class="clearfix">
  
      <div id="column1" data-id="__ID__" class="interior">
        <header>
          <!-- <h1>monthsShort</h1> -->
          <div id="gtoc">
            <ul>
              <!-- <li>v</li> -->
              <li>
                <a href="index.html#/customization/month-abbreviations/" name="toc">&#x8FD4;&#x56DE;&#x4E0A;&#x5C42;&#x6587;&#x6863;</a>
              </li>
              <li style="border: none;">
                <a href="javascript:window.open('https://github.com/momentjscn/moment-docs-cn/edit/master/moment/07-customization/02-month-abbreviations.md');" rel="nofollow" target="_blank">&#x63D0;&#x4EA4;&#x4FEE;&#x6539;</a>
              </li>
              <!-- <li>
                <a href="/search__SEARCH_PARAM__" name="toc">搜索</a>
              </li> -->
            </ul>
          </div>
          <hr>
        </header>

        <div id="biz_item"></div>
  
        <div id="apicontent">
          <div id="content_left">
							<div class="docs-method-signature">
								<pre><code class="language-js">// &#x4ECE; 2.12.0 &#x5F00;&#x59CB;
moment.updateLocale(&apos;en&apos;, {
    monthsShort : String[]
});
moment.updateLocale(&apos;en&apos;, {
    monthsShort : Function
});
moment.updateLocale(&apos;en&apos;, {
    monthsShort : {
        format: String[],
        standalone : String[]
    }
});
// &#x4ECE; 2.11.0 &#x5F00;&#x59CB;
moment.locale(&apos;en&apos;, {
    monthsShort : {
        format: String[],
        standalone : String[]
    }
});
// &#x4ECE; 2.8.1 &#x81F3; 2.11.2
moment.locale(&apos;en&apos;, {
    monthsShort : String[]
});
moment.locale(&apos;en&apos;, {
    monthsShort : Function
});

// &#x5E9F;&#x5F03;&#x4E8E; 2.8.1
moment.lang(&apos;en&apos;, {
    monthsShort : String[]
});
moment.lang(&apos;en&apos;, {
    monthsShort : Function
});
</code></pre>

							</div>
<p><code>Locale#monthsShort</code> &#x5E94;&#x662F;&#x6708;&#x4EFD;&#x7F29;&#x5199;&#x7684;&#x6570;&#x7EC4;&#x3002;</p>
<pre><code class="language-javascript">moment.updateLocale(&apos;en&apos;, {
    monthsShort : [
        &quot;Jan&quot;, &quot;Feb&quot;, &quot;Mar&quot;, &quot;Apr&quot;, &quot;May&quot;, &quot;Jun&quot;,
        &quot;Jul&quot;, &quot;Aug&quot;, &quot;Sep&quot;, &quot;Oct&quot;, &quot;Nov&quot;, &quot;Dec&quot;
    ]
});
</code></pre>
<p>&#x4E0E; <code>Locale#months</code> &#x4E00;&#x6837;&#xFF0C;<code>Locale#monthsShort</code> &#x4E5F;&#x53EF;&#x4EE5;&#x662F;&#x56DE;&#x8C03;&#x51FD;&#x6570;&#x3002;</p>
<pre><code class="language-javascript">moment.updateLocale(&apos;en&apos;, {
    monthsShort : function (momentToFormat, format) {
        if (/^MMMM/.test(format)) {
            return nominative[momentToFormat.month()];
        } else {
            return subjective[momentToFormat.month()];
        }
    }
});
</code></pre>
<p>&#x6CE8;&#x610F;&#xFF1A;&#x4ECE; <strong>2.11.0</strong> &#x7248;&#x672C;&#x5F00;&#x59CB;&#xFF0C;&#x4E0E; <code>Locale#months</code> &#x4E00;&#x6837;&#xFF0C;<code>Locale#monthsShort</code> &#x53EF;&#x4EE5;&#x662F;&#x5177;&#x6709; <code>standalone</code> &#x548C; <code>format</code> &#x7528;&#x4F8B;&#x7684;&#x5BF9;&#x8C61;&#x3002;</p>
<pre><code class="language-javascript">moment.updateLocale(&apos;en&apos;, {
    monthsShort : {
        format: &apos;&#x44F;&#x43D;&#x432;_&#x444;&#x435;&#x432;_&#x43C;&#x430;&#x440;_&#x430;&#x43F;&#x440;_&#x43C;&#x430;&#x44F;_&#x438;&#x44E;&#x43D;&#x44F;_&#x438;&#x44E;&#x43B;&#x44F;_&#x430;&#x432;&#x433;_&#x441;&#x435;&#x43D;_&#x43E;&#x43A;&#x442;_&#x43D;&#x43E;&#x44F;_&#x434;&#x435;&#x43A;&apos;.split(&apos;_&apos;),
        standalone: &apos;&#x44F;&#x43D;&#x432;_&#x444;&#x435;&#x432;_&#x43C;&#x430;&#x440;&#x442;_&#x430;&#x43F;&#x440;_&#x43C;&#x430;&#x439;_&#x438;&#x44E;&#x43D;&#x44C;_&#x438;&#x44E;&#x43B;&#x44C;_&#x430;&#x432;&#x433;_&#x441;&#x435;&#x43D;_&#x43E;&#x43A;&#x442;_&#x43D;&#x43E;&#x44F;_&#x434;&#x435;&#x43A;&apos;.split(&apos;_&apos;)
    }
});
</code></pre>
					</div>
          <div id="content_right">
							<div class="docs-method-signature">
								<pre><code class="language-js">// From 2.12.0 onward
moment.updateLocale(&apos;en&apos;, {
    monthsShort : String[]
});
moment.updateLocale(&apos;en&apos;, {
    monthsShort : Function
});
moment.updateLocale(&apos;en&apos;, {
    monthsShort : {
        format: String[],
        standalone : String[]
    }
});
// From 2.11.0
moment.locale(&apos;en&apos;, {
    monthsShort : {
        format: String[],
        standalone : String[]
    }
});
// From 2.8.1 to 2.11.2
moment.locale(&apos;en&apos;, {
    monthsShort : String[]
});
moment.locale(&apos;en&apos;, {
    monthsShort : Function
});

// Deprecated in 2.8.1
moment.lang(&apos;en&apos;, {
    monthsShort : String[]
});
moment.lang(&apos;en&apos;, {
    monthsShort : Function
});
</code></pre>

							</div>
<p><code>Locale#monthsShort</code> should be an array of the month abbreviations.</p>
<pre><code class="language-javascript">moment.updateLocale(&apos;en&apos;, {
    monthsShort : [
        &quot;Jan&quot;, &quot;Feb&quot;, &quot;Mar&quot;, &quot;Apr&quot;, &quot;May&quot;, &quot;Jun&quot;,
        &quot;Jul&quot;, &quot;Aug&quot;, &quot;Sep&quot;, &quot;Oct&quot;, &quot;Nov&quot;, &quot;Dec&quot;
    ]
});
</code></pre>
<p>Like <code>Locale#months</code>, <code>Locale#monthsShort</code> can be a callback function as well.</p>
<pre><code class="language-javascript">moment.updateLocale(&apos;en&apos;, {
    monthsShort : function (momentToFormat, format) {
        if (/^MMMM/.test(format)) {
            return nominative[momentToFormat.month()];
        } else {
            return subjective[momentToFormat.month()];
        }
    }
});
</code></pre>
<p><strong>Note:</strong> From version <strong>2.11.0</strong>, like <code>Locale#months</code>, <code>Locale#monthsShort</code> can be an object with <code>standalone</code> and <code>format</code> cases.</p>
<pre><code class="language-javascript">moment.updateLocale(&apos;en&apos;, {
    monthsShort : {
        format: &apos;&#x44F;&#x43D;&#x432;_&#x444;&#x435;&#x432;_&#x43C;&#x430;&#x440;_&#x430;&#x43F;&#x440;_&#x43C;&#x430;&#x44F;_&#x438;&#x44E;&#x43D;&#x44F;_&#x438;&#x44E;&#x43B;&#x44F;_&#x430;&#x432;&#x433;_&#x441;&#x435;&#x43D;_&#x43E;&#x43A;&#x442;_&#x43D;&#x43E;&#x44F;_&#x434;&#x435;&#x43A;&apos;.split(&apos;_&apos;),
        standalone: &apos;&#x44F;&#x43D;&#x432;_&#x444;&#x435;&#x432;_&#x43C;&#x430;&#x440;&#x442;_&#x430;&#x43F;&#x440;_&#x43C;&#x430;&#x439;_&#x438;&#x44E;&#x43D;&#x44C;_&#x438;&#x44E;&#x43B;&#x44C;_&#x430;&#x432;&#x433;_&#x441;&#x435;&#x43D;_&#x43E;&#x43A;&#x442;_&#x43D;&#x43E;&#x44F;_&#x434;&#x435;&#x43A;&apos;.split(&apos;_&apos;)
    }
});
</code></pre>
					</div>
          <div></div>
        </div>
      </div>
    </div>
  </div>
  
  <script src="static/js/highlight.min.js"></script>
  <script src="static/js/javascript.min.js"></script>
  <script>hljs.initHighlightingOnLoad();</script>
  <script>var _hmt = _hmt || []; (function () { var hm = document.createElement("script"); hm.src = "//hm.baidu.com/hm.js?7a7f78c805fbacc7e075d34f153031aa"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })();</script>

  <style>
    .hero-centered {
      margin: 0;
          margin-left: 10px;
    }
#gtoc ul {
  list-style: none;
  margin-left: 0;
  line-height: 1.5rem;
  padding: 0;
}
#gtoc>ul>li {
  display: inline;
  border-right: 1px solid #000;
  margin-right: .4rem;
  padding-right: .4rem;
}
#gtoc>ul>li>a {
  color: #61b2a7;
}
#content_left {
  width: 49%;float: left;border-right: 1px solid #eee;    padding-right: 2%;
}
#content_right {
float: left;width: 48%;margin-left: 3%;
}
#column1 {
  padding: 0 2rem;
}
  </style>


</body></html>